(function() {
    var e = /[?&]([^=&?]+)=([^=&?]*)/g, r = null;
    window.params = {};
    while (r = e.exec(location.search))
        window.params[r[1]] = r[2];

    var myApp = angular.module('myApp');

    myApp.controller("myController", function($scope, $rootScope, $log, myUserTableOption, reqDataByAjax) {
        // 设置用户表Option
        $scope.option = myUserTableOption;
        $scope.option.ajax = ajax;
        function ajax(data, callback, settings) {
            data.user_id=window.params.user_id;
            reqDataByAjax("/scheduling/api/manage/EMIE/getall", data).then(function (ret) {
                callback({
                    "draw": data.draw,
                    "recordsFiltered": ret[1][0].recordsTotal,
                    "recordsTotal": ret[2][0].recordsFiltered,
                    "data": ret[0]
                });
            });
        }

    });


})();